<script>
$(document).ready(function() {
	<?php
	if ($error == 'file_type') echo 'showNoti("Hỗ trợ .png .jpg .gif .swf", "Định dạng file không hợp lệ!", "Err");';
	if ($updated == 1) echo 'showNoti("Bài viết: '.$name.'", "Cập nhập bài viết thành công!", "Ok");';
	if ($failed == 1) echo 'showNoti("Bài viết: '.$name.'", "Cập nhập bài viết thất bại!", "Err");';
	?>	
});
</script>
<script src="js/tinymce/tinymce.min.js"></script>
<script src="js/tinymce.js"></script>
<?php 
echo form_open_multipart($action, array('id' => 'updateFrm'));
echo form_input(array('type' => 'hidden', 'name' => 'token', 'value' => $GLOBALS['var']['token']));
echo form_input(array('type' => 'hidden', 'name' => 'id', 'value' => $info['id']));
echo module_open();
?>
<tr>
    <td>
        <input type="hidden" class="tabId" value="<?php echo $GLOBALS['var']['mytab'] ?>" />
        <ul id="myTab" class="nav nav-tabs">
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-0" data-toggle="tab">Thông tin</a></li>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-1" data-toggle="tab">Nội dung<?php if ($GLOBALS['cfg']['multi_lang']) { ?> tiếng việt<?php } ?></a></li>
            <?php if ($GLOBALS['cfg']['multi_lang']) { ?><li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-2" data-toggle="tab">Nội dung tiếng anh</a></li><?php } ?>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 3 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-3" data-toggle="tab">Seo tags</a></li>
            <li class="dropdown active show640">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="current-tab-name">Thông tin</span> <span class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li <?php echo ($GLOBALS['var']['mytab'] == 0 ? ' class="active"' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-0" data-toggle="tab">Thông tin cơ bản</a></li>
                    <li <?php echo ($GLOBALS['var']['mytab'] == 1 ? ' class="active"' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-1" data-toggle="tab">Nội dung<?php if ($GLOBALS['cfg']['multi_lang']) { ?> tiếng việt<?php } ?></a></li>
                    <?php if ($GLOBALS['cfg']['multi_lang']) { ?><li <?php echo ($GLOBALS['var']['mytab'] == 2 ? ' class="active"' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-2" data-toggle="tab">Nội dung tiếng anh</a></li><?php } ?>
                    <li <?php echo ($GLOBALS['var']['mytab'] == 3 ? ' class="active"' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-3" data-toggle="tab">Seo tags</a></li>
                </ul>
            </li>
        </ul>
        <div id="myTabContent" class="tab-content">
            <div id="tabs-0" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>">
                <table cellpadding="0" cellspacing="0" width="100%" border="0"> 
                    <tr>
                        <td class="fr">
                            <div class="tdleft">Ngày đăng</div>
                            <div class="tdright"><input type="text" name="date_added" id="date_added" data-format="yy-mm-dd" value="<?php echo $info['date_added'] ?>" style="width:120px !important;" /></div>
                        </td>
                    </tr>               
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Chuyên mục tin</div>
                            <div class="tdright clr320"><ul class="cat_treeview filetree treeview" style="height: 150px !important; width: 250px;"><?php echo cat_tree($category_list, 0, $info['cat'], 'radio'); ?></ul></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Ảnh minh họa</div>
                            <div class="tdright clr320">
                                <div class="image-wrap">
                                    <input class="selectImage" type="file" name="img" />
                                    <div class="image">
                                        <div class="no-image">
                                            <i class="icon36 glyphicons picture" style="<?php if(goodfile(NEWS.'thumbs/'.$info['img'])) { ?>display:none;<?php } ?>"></i>
                                            <img class="preview_img" title="Click để chọn ảnh" style="<?php if(!goodfile(NEWS.'thumbs/'.$info['img'])) { ?>display:none;<?php } ?>" src="<?php echo NEWS ?>thumbs/<?php echo $info['img']?>" />
                                            <?php if ($info['img']) echo del_image('img', $info['id']); ?>
                                        </div>
                                    </div>
                                    <div class="image-des">
                                        <h2></h2>
                                        <p>Hình thu nhỏ sẽ được tạo ra tự động từ hình ảnh đại diện</p>
                                        <div class="file-name">
                                            <div>
                                                <i class="icon glyphicons remove_2"></i> <p></p>
                                            </div>
                                        </div>
                                        <div class="input-group" style="width: 200px !important">
                                            <span class="input-group-addon" title="Alternative text/title"><i class="icon glyphicons chat"></i></span>
                                            <input type="text" name="img_alt" value="<?php echo $info['img_alt'] ?>" style="width: 250px;" class="" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class='fr'>
                            <div class="tdleft">Kích hoạt</div>
                            <div class="tdright">
                                <ul class='css3-radios'>
                                    <li>
                                        <label>
                                            <input name='active' type='radio' value='1'<?php echo($info['active'] == 1 ? ' checked="checked"' : '') ?> />
                                            <span>Có</span>
                                        </label>
                                    </li>
                                    <li>
                                        <label>
                                            <input name='active' type='radio' value='0'<?php echo($info['active'] == 0 ? ' checked="checked"' : '') ?> />
                                            <span>Không</span>
                                        </label>
                                    </li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="tabs-1" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>">
                <table width="100%">
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Tiêu đề trang <span style="color:red">*</span></div>
                            <div class="tdright clr320">
                                <input type="text" data-required="1" id="name_vn" name="name_vn" value="<?php echo $info['name_vn'] ?>" style="width:300px;" />
                                <div class="errordiv name_vn"><div class="arrow"></div>Vui lòng nhập tiêu đề trang!</div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Nội dung tóm tắt</div>
                            <div class="tdright clr320"><textarea wrap="VIRTUAL" id="des_vn" name="des_vn" style="height:50px"><?php echo $info['des_vn']?></textarea></div>
                        </td>
                    </tr>
                    <tr>
                    	<td class="fr">
                            <div class="tdleft clr320">Nội dung chi tiết</div>
                            <div class="tdright clr320">
                                <textarea wrap="VIRTUAL" class="mceEditor" id="info_vn" name="info_vn" style="height: 300px;"><?php echo $info['info_vn']?></textarea>
                            </div>
                    	</td>
                    </tr>
                </table>
            </div>
            <?php
            if ($GLOBALS['cfg']['multi_lang'])
            {
            ?>
            <div id="tabs-2" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>">
                <table width="100%">
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Tiêu đề trang <span style="color:red">*</span></div>
                            <div class="tdright clr320"><input type="text" id="name_en" name="name_en" value="<?php echo $info['name_en'] ?>" style="width:300px;" /></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Nội dung tóm tắt</div>
                            <div class="tdright clr320"><textarea wrap="VIRTUAL" id="des_en" name="des_en" style="height:50px"><?php echo $info['des_en']?></textarea></div>
                        </td>
                    </tr>
                    <tr>
                    	<td class="fr">
                            <div class="tdleft clr320">Nội dung chi tiết</div>
                            <div class="tdright clr320">
                                <textarea wrap="VIRTUAL" class="mceEditor" id="info_en" name="info_en" style="height: 300px;"><?php echo $info['info_en']?></textarea>
                            </div>
                    	</td>
                    </tr>
                </table>
            </div>
            <?php
        	}
        	?>
            <div id="tabs-3" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 3 ? ' active' : '') ?>">
                <table width="100%">
                	<tr>
                        <td class="fr">
                            <div class="tdleft clr320">Seo title <span style="color:red">*</span></div>
                            <div class="tdright clr320"><input type="text" name="seo_title" id="seo_title" value="<?php echo $info['seo_title']?>" style="width:350px;" /></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="fr">
                            <div class="tdleft clr320">Seo description</div>
                            <div class="tdright clr320"><textarea name="seo_desc" style="height:80px; resize: none;"><?php echo $info['seo_desc']?></textarea></div>
                        </td>
                    </tr>
                    <tr>
                    	<td class="fr">
                            <div class="tdleft clr320">Seo keywords</div>
                    	    <div class="tdright clr320"><input type="text" name="tags" id="tags" value="<?php echo $info['tags']?>" style="width:500px;" /></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="fr">
                            <div class="tdleft">Tạo sitemap</div>
                            <div class="tdright">
                                <ul class="css3-radios">
                                    <li>
                                    	<label>
                                    		<input name="sitemap" type='radio' value="1"<?php echo($info['sitemap'] == 1 ? ' checked="checked"' : '') ?> />
                                    		<span>Có</span>
                                    	</label>
                                    </li>
                                    <li>
                                    	<label>
                                    		<input name="sitemap" type='radio' value="0"<?php echo($info['sitemap'] == 0 ? ' checked="checked"' : '') ?> />
                                    		<span>Không</span>
                                    	</label>
                                    </li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </td>
</tr>
<?php
echo module_close();
echo form_close();
?>